package model.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;


public class MapArray implements Iterable<String> {
	private HashMap<String, ArrayList<String>> data;
	
	public MapArray() {
		data = new HashMap<String, ArrayList<String>>();
	}
	
	public void put(String key, String value) {
		ArrayList<String> map = data.get(key);
		
		if (map == null) {
			map = new ArrayList<String>();
			data.put(key, map);
		}
		
		map.add(value);
	}

	public ArrayList<String> get(String key) {
		return data.get(key);
	}

	public Iterator<String> iterator() {
		return data.keySet().iterator();
	}

	public boolean containsKey(String key) {
		return data.containsKey(key);
	}
}
